<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="java.text.SimpleDateFormat,java.text.DateFormat,java.util.Date"%>
<%@ include file="/WEB-INF/common/taglib.jsp" %>
<%
	Date now = new Date();
	DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	String nowStr = df.format(now);
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>社区列表</title>
    
	<link rel="stylesheet" href="${ctx }/static/css/Master.css"/>
	<link rel="stylesheet" href="${ctx }/static/css/lq.datetimepick.css"/>
	
	<script type="text/javascript" src="${ctx }/static/js/jquery-1.9.0.min.js"></script>
	<script type="text/javascript" src="${ctx }/static/js/simpletooltip.min.js"></script>
	<script type="text/javascript" src="${ctx }/static/js/Common.js"></script>
	<script type="text/javascript" src="${ctx }/static/js/jsScroller.js"></script>
	<script type="text/javascript" src="${ctx }/static/js/jsScrollbar.js"></script>
	<script type="text/javascript" src="${ctx }/static/js/orgCommon.js"></script>
	<script type="text/javascript" src="${ctx }/static/js/layer.js"></script>
	<%-- 基础js,所有页面都需要引入此js,依赖layer.js --%>
   <script src="${ctx}/static/js/common/base.js"></script>
	<script type="text/javascript">
	function isDisabled(comId,comName,normal)
	{
		var msg = '确认'+(normal==1?'禁用':'启用')+'"'+comName+'"吗?';
		top.layer.confirm(msg, {icon: 3}, function(index){
			$.ajax({    
			    url:"${ctx}/community/updateCommunityNormal",   
			    data:{"comId":comId,"normal":(normal==1?0:1)},    
			    type:"post",    
			    cache:false,    
			    dataType:"json",
			    async:true, //默认为true 异步    
			    success:function(data) {
		            top.layer.msg("操作成功!!",{},function(){
			        	window.location.reload();   
		            });
			     }
			});
		});
	}
	
	function searchCommunity(){
		$("#comForm").submit();
	}
	
	</script>
	<style type="text/css">
		.SearchList li input {
		  border: 1px solid #dfdfdf;
		  height: 30px;
		  line-height: 16px;
		  padding: 5px;
		  width: 148px;
		  margin-right: 10px;
		  }
	</style>
  </head>
  
  <body>
    <div class="wrapper">
    	<form id="comForm" action="${ctx }/community/findCommunityList.do" method="get">
			<section>
				<section class="boxRight">
					<div class="context boxborder">
						<div class="SearchList">
							<ul class="clearfix">
								<li><span class="name">社区名：</span><span class="pt"><input id="comName" name="comName" type="text" value="${result.entity.comName }" /></span></li>
								<li><span class="name">组织归属：</span>
									<select class="selectul selectul_w1 organization"><option value="0">请选择</option></select>
									<select class="selectul selectul_w1 trench"><option value="0">请选择</option></select>
									<select class="selectul selectul_w1 tenement"><option value="0">请选择</option></select>
								</li>
								<li class="combtn pr"><a href="javascript:searchCommunity();">查询</a></li>
							</ul>
						</div>
						<div class="pr prlink"><a href="${ctx }/community/addCommunity.do"><span class="icon j_icon"></span>新增社区</a>
						<a href="${ctx }/community/import.do"><span class="icon j_icon"></span>批量导入</a>
						<a href="${ctx}/community/download.do"><span class="icon j_icon"></span>导入模版</a></div>
						<div class="com_table">
							<table width="100%" cellpadding="0" cellspacing="0">
								<tr>
									<th>序号</th>
									<th>社区名</th>
									<th>所在物业</th>
									<th>所在地</th>
									<th>是否认证</th>
									<th>状态</th>
									<th>创建时间</th>
									<th>操作</th>
								</tr>
								<c:forEach var="com" items="${result.entityList }" varStatus="coms">
								<tr>
									<td>${coms.index + 1 }</td>
									<td>${com.comName }</td>
									<td>${com.orgName }</td>
									<td>${com.provinceName }${com.cityName }${com.areaName }</td>
									<td>${com.checkContent }</td>
									<td>${com.normalContent }</td>
									<td>${com.insertDate }</td>
									<td><a class="icon micon_9" title="详情" href="${ctx }/community/findCommunityDetails.do?comId=${com.comId}""></a>
									<a class="icon micon_${org.normal == 1? 1 : 12}" title="禁用" href="javascript:isDisabled('${com.comId}','${com.comName}','${com.normal}');"></a><a class="icon micon_2" title="编辑" href="${ctx }/community/findCommunity.do?comId=${com.comId}"></a></td>
								</tr>
								</c:forEach>
							</table>
							<%-- 分页 --%>
							<%@ include file="/WEB-INF/common/page.jsp"%>
						</div>
					</div>
				
			</section>
			</section>
			</form>
		<!--/左边-->
		</section>
	</div>
  </body>
</html>
